TEST     START   1000              TEST PROGRAM FOR SIC SOFTWARE
FIRST    STL     RETADR            SAVE RETURN ADDRESS
CLOOP    JSUB    RDREC             READ INPUT RECORD
thomas   MACRO   &p1,&p2                                
         ***********************
         STL     &p1            
         LDA     &p2               
         ***********************
         MEND
         COMP    ONE                 PLUS EOL OR EOF) 
         JEQ     ENDFIL            EXIT IF EOF FOUND
rahul    MACRO   &q1,&q2,&q3
         ************************
         LDX     &q1
         LDB     &q2
         STL     &q3
         ************************
         MEND
         JSUB    WRREC             WRITE OUTPUT RECORD
         J       CLOOP             LOOP 
ENDFIL   LDA     EOF               INSERT END OF FILE MARKER
         RSUB                      RETURN TO CALLER 
EOF      BYTE    C'EOF'
         thomas  CLOOP,FIRST       ************Call         
THREE    WORD    3
ZERO     WORD    0
LENGTH   RESW    1
BUFFER   RESB    4096              4096-BYTE BUFFER AREA
         rahul   A,B,C             ***********Call         
. 
.       SUBROUTINE TO READ RECORD INTO BUFFER
RDREC    LDX     ZERO              CLEAR LOOP COUNTER 
RLOOP    TD      INPUT             TEST INPUT DEVICE
         JEQ     RLOOP             LOOP UNTIL READY 
EXIT     STCH    BUFFER            STORE EOL/EOF IN BUFFER
         RSUB                      RETURN TO CALLER 
INPUT    BYTE    X'F3'             CODE FOR INPUT DEVICE
MAXLEN   WORD    4096 
. 
.       SUBROUTINE TO WRITE RECORD FROM BUFFER 
WRREC    LDX     ZERO              CLEAR LOOP COUNTER
         RSUB                      RETURN TO CALLER 
         END     FIRST
